import type { AxiosRequestConfig, AxiosInstance, AxiosResponse } from 'axios';
import type { ILoadingInstance } from 'element-plus';
interface dsqInterceptors<T = AxiosResponse> {
  requestInterceptor?: (config: AxiosRequestConfig) => AxiosRequestConfig;
  requestInterceptorCatch?: (err: any) => any;
  responseInterceptor?: (res: T) => T;
  responseInterceptorCatch?: (err: any) => any;
}
interface dsqRequestConfig<R = AxiosResponse> extends AxiosRequestConfig {
  interceptors?: dsqInterceptors<R>;
  showLoading?: boolean;
}

//interceptor传入的参数类型
interface IDsqThisType {
  instance: AxiosInstance;
  interceptors?: dsqInterceptors;
  loading?: ILoadingInstance;
  showLoading: boolean;
}
export { dsqInterceptors, dsqRequestConfig, IDsqThisType };
